﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SystemNewsManage.aspx.cs"
    Inherits="NJL.WebManage.SystemNews.SystemNewsManage" %>

<%@ Import Namespace="Royalsoft.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
              <style type="text/css">
        #enlarge_images
        {
            position: absolute;
            display: none;
            z-index: 2;
            border: 5px solid #f4f4f4;
        }
    </style>
    <style type="text/css">
        ul
        {
            list-style-type: none;
            margin: 0;
            width: 100%;
        }
        ul li
        {
            width: 150px;
            float: left;
        }
        .now
        {
            color: Red;
        }
        .onshow{background:#d6e6f5;}
    </style>
    <script type="text/javascript">
        function textboxSelect() {
            var checkbox = document.getElementsByName("cbxSingle");
            for (var i = 0; i < checkbox.length; i++) {
                checkbox[i].checked = !checkbox[i].checked;
            }
        }
        function checkCheckboxState() {
            var checkbox = document.getElementsByName("cbxSingle");
            var hiddenId = "";
            var count = 0;
            for (var i = 0; i < checkbox.length; i++) {
                if (checkbox[i].checked == true) {
                    hiddenId += checkbox[i].value + ",";
                    count++;
                }
            }
            if (count == 0) {
                alert('请选择您要删除的记录')
                return false;
            }
            else {
                if (window.confirm("您确定要删除该记录？")) {
                    hiddenId = hiddenId.substring(0, hiddenId.length - 1);
                    document.getElementById("<%=HSelectId.ClientID %>").value = hiddenId;
                }
                else {
                    return false;
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="main_content fr">
        <div class="gray_bd">
            <div class="table_title">
                新闻管理</div>
            <div style="text-align: center">
                <ul>
                    <asp:Repeater ID="rptList" runat="server">
                        <ItemTemplate>
                            <li><a href="SystemNewsManage.aspx?TypeId=<%#Eval("TYPE_CODE") %>" <%#Eval("TYPE_CODE").Equals(Request.QueryString["TypeId"])?"class=\"now\"":"" %>>
                                <%#Eval("TYPE_NAME")%></a></li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </div>
            <div style="clear:both;">
                <span id="dispArea" runat="server">地区:
                    <asp:DropDownList ID="ddlarea" runat="server">
                    </asp:DropDownList>
                </span><span>新闻标题：
                    <asp:TextBox ID="txtKeywords" runat="server"></asp:TextBox>
                    &nbsp;
                    <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" /></span>
            </div>
            <div class="pad5px">
                <div class="border_b_dotted">
                    <table class="tableliststyle" cellspacing="0" rules="all" border="1" id="demo">
                        <tr class="gridheader">
                            <th style="width: 5%">
                                <input id="cbxAll" type="checkbox" onclick="textboxSelect()" />
                            </th>
                            <th>
                                序号
                            </th>
                            <th>
                                标题
                            </th>
                            <th>
                                标签
                            </th>
                            <th>
                                图片
                            </th>
                            <th>
                                类型
                            </th>
                            <th>
                                发布时间
                            </th>
                            <th>
                                排序
                            </th>
                            <th>
                                置顶
                            </th>
                            <th>
                                首页
                            </th>
                            <th>
                                发布
                            </th>
                            <th>
                                编辑
                            </th>
                            <th>
                                删除
                            </th>
                        </tr>
                        <asp:Repeater ID="rptUserList" runat="server" OnItemCommand="rptUserList_ItemCommand"
                            OnItemDataBound="rptUserList_ItemDataBound">
                            <ItemTemplate>
                                <tr onmouseover="this.className='onshow'" onmouseout="this.className=''" class="">
                                    <td align="center">
                                        <input id="<%#Eval("ID") %>" type="checkbox" value="<%#Eval("ID") %>" name="cbxSingle" />
                                    </td>
                                    <td align="center">
                                        <asp:Literal ID="litNum" runat="server"></asp:Literal>
                                    </td>
                                    <td align="left" title="<%#Eval("NEWS_TITLE") %>">
                                        <%#PageValidate.InputText(Eval("NEWS_TITLE").ToString(),8)%>
                                    </td>
                                    <td align="left" title="<%#Eval("NEWS_TAG") %>">
                                        <%#PageValidate.InputText(Eval("NEWS_TAG").ToString(),5)%>
                                    </td>
                                    <td>
                                        <asp:Image ID="Image1" runat="server" Width="60px" Height="45px" />
                                    </td>
                                    <td align="center">
                                        <%#Eval("TYPE_NAME")%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("CREATE_DATE_TIME", "{0:yyyy-MM-dd HH:mm:ss}")%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("SORT")%>
                                    </td>
                                    <td align="center">
                                        <asp:ImageButton ID="imgbtn1" runat="server" CommandName="imgbtn1" CommandArgument='<%#Eval("ID") %>'
                                            AlternateText='<%#Eval("IS_TOP") %>' />
                                    </td>
                                    <td align="center">
                                        <asp:ImageButton ID="imgbtn2" runat="server" CommandName="imgbtn2" CommandArgument='<%#Eval("ID") %>'
                                            AlternateText='<%#Eval("IS_INDEX") %>' />
                                    </td>
                                    <td align="center">
                                        <asp:ImageButton ID="imgbtn3" runat="server" CommandName="imgbtn3" CommandArgument='<%#Eval("ID") %>'
                                            AlternateText='<%#Eval("IS_PUBLISH") %>' />
                                    </td>
                                    <td align="center">
                                        <a href="EditSystemNews.aspx?id=<%#Eval("ID") %>">编辑</a>
                                    </td>
                                    <td align="center">
                                        <asp:LinkButton ID="lbtnDel" runat="server" CommandName="Del" CommandArgument='<%#Eval("ID") %>'
                                            OnClientClick="return confirm('您确定要删除该信息吗？')">删除</asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                    <div style="text-align: left; margin-top: 5px;">
                        <asp:Button ID="btnDel" runat="server" Text="删除" OnClientClick="return checkCheckboxState()"
                            OnClick="btnDel_Click1" />
                    </div>
                </div>
                <div style="text-align: center">
                    共
                    <asp:Literal ID="lit" runat="server"></asp:Literal>
                    条记录&nbsp;&nbsp;&nbsp;&nbsp; 共
                    <asp:Literal ID="litAllPage" runat="server"></asp:Literal>
                    页&nbsp;&nbsp;&nbsp;&nbsp; 第
                    <asp:Literal ID="litCurrentPage" runat="server"></asp:Literal>
                    页
                    <asp:LinkButton ID="lbtnFirst" runat="server" OnClick="lbtnFirst_Click">首页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnPrev" runat="server" OnClick="lbtnPrev_Click">上一页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnNext" runat="server" OnClick="lbtnNext_Click">下一页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnEnd" runat="server" OnClick="lbtnEnd_Click">末页</asp:LinkButton>
                    跳转到第
                    <asp:TextBox ID="txtPage" runat="server" Width="32px" MaxLength="8" Style="text-align: center"></asp:TextBox>&nbsp;页&nbsp;
                    <asp:Button ID="btnRir" runat="server" Text="确定" OnClick="btnRir_Click" />
                </div>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="HSelectId" runat="server" />
    </form>
            <div id="enlarge_images">
    </div>
    <script type="text/javascript">
        var demo = document.getElementById("demo");
        var gg = demo.getElementsByTagName("img");
        var ei = document.getElementById("enlarge_images");
        for (i = 0; i < gg.length; i++) {
            var ts = gg[i];
            ts.onmousemove = function (event) {
                event = event || window.event;
                ei.style.display = "block";
                ei.innerHTML = '<img src="' + this.src + '" />';
                ei.style.top = document.body.scrollTop + event.clientY + 10 + "px";
                ei.style.left = document.body.scrollLeft + event.clientX + 10 + "px";
            }
            ts.onmouseout = function () {
                ei.innerHTML = "";
                ei.style.display = "none";
            }
            ts.onclick = function () {
                window.open(this.src);
            }
        }
    </script>
</body>
</html>
